SafeNet Synchronization Agent log files
The SafeNet Synchronization Agent log file records information pertinent to the service.
You can also view transaction and synchronization details.
Configure the log level
To configure the level of detail that is displayed in SafeNet Synchronization Agent log files:
-
From an administrator account on a Windows computer, launch SafeNet Synchronization Agent by clicking Start > SafeNet > Agents > Sync Agent. If necessary, right-click Sync Agent and select Run as administrator.
-
Select File > Log Level and choose from the following options:
-
Off—Do not display log files.
-
Error—Display only error messages.
-
Warning—Display error and warning messages.
-
Info—Display error, warning, and info messages.
-
Debug—Display error, warning, info, and debug messages.
-
Trace—Enhanced debug logging in special circumstances.
-
Configure the log file location
The default location for SafeNet Synchronization Agent log files is C:\Program Files\CRYPTOCard\BlackShield ID\sasLog. To change the location into which STA saves SafeNet Synchronization Agent log files:
-
In the SafeNet Synchronization Agent window, navigate to the Log4Net file placed at the default path, C:\Program Files\CRYPTOCard\BlackShield ID\SasConfigs.
-
As Administrator, within the <log4net debug … (shown by a blue bar in the example that follows), make the following edits to the file:
-
Add an appender, for example: <appender name=“RollingFile” … (shown by a red bar in the example).
-
Define the log file destination, for example, <file value=“D:\SyncAgent\Log\”/>.
-
Add an appender-ref (for example, <appender-ref ref=“RollingFile”/> to <root> … (shown by a green bar in the example).
-
-
Click Save.
Each ‘appender name’ must be unique and accompanied by a matching ‘appender-ref’. For additional information about Apache log4net™ appenders, see https://logging.apache.org/log4net/release/config-examples.html.
Example
Configure rolling backups
You can configure SafeNet Synchronization Agent to save a maximum number of log files and then delete the oldest log file each time a new log file is created.
For example, to maintain a rolling backup of the 10 most recent log files (maximum size = 100 KB) each day:
-
In the SafeNet Synchronization Agent window, navigate to the Log4Net file. See Configure the log file location.
-
As Administrator, make the following edits to the file:
-
Add an appender, for example: appender name=“RollingLogFileAppender”.
-
Set the following values:
– rollingStyle value="Composite" (This value enables you to combine Date and Size parameters.)
– datePattern = "yyyy-MM-dd" (This value will roll the backup log file every day.)
– maxSizeRollBackups = "10" (The maximum number of backup files that are kept. After this number is reached, the oldest backup file is erased when the next backup file is created.)
– maximumFileSize value="100KB" (Recommended)
-
Add an appender-ref (for example, <appender-ref ref=“RollingLogFileAppender”/> to <root>.
-
-
Click Save.
It is important that you select a datePattern that meets your requirements. For example, if the datePattern includes the time (yyyy-MM-dd HH:mm) and maxSizeRollbackups = 10, then SafeNet Synchronization Agent will maintain a rolling backup of the 10 most recent log files every minute.
Example
This example shows how to configure SafeNet Synchronization Agent to save the 10 most recent log files, of up to 100 KB each, every day.
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logfile" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<datePattern value="yyyyMMdd" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="100KB" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>